﻿using System;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;
using QuanLyTuyenSinh.Base;

namespace QuanLyTuyenSinh.Reports
{
    public partial class ReportDSTTKhoi : Form
    {
      public ReportDSTTKhoi()
        {
            InitializeComponent();
        }

        private void ReportDSTTKhoi_Load(object sender, EventArgs e)
        {
            ComboKhoithi.DataSource = monthibus.GetKhoithiUngVoiNganhHoc();
            ComboKhoithi.ValueMember = "Khoithi";
            ComboKhoithi.DisplayMember = "Khoithi";
        }

        private void cmdDS_Click(object sender, EventArgs e)
        {
            SqlCommand cmd = new SqlCommand("select * from BangDiemDo where Khoithi='" + ComboKhoithi.Text.Trim() + "'", ConnectData.Getcon());
            SqlDataAdapter DTA = new SqlDataAdapter(cmd);
            DataTable DTL = new DataTable();
            DataSet DTS = new DataSet();
            DTA.Fill(DTS, "BangDiemDo");
            DTL = DTS.Tables["BangDiemDo"];
            rptDSTTKhoi cry = new rptDSTTKhoi();
            cry.SetDataSource(DTL);
            CryStalDSTTKhoi.ReportSource = cry;
            CryStalDSTTKhoi.Refresh();
        }

      
    }
}
